#  秒 -->毫秒 --> 微秒 --> 纳秒
import time
# print(time.time())
#   1970年为计算机元年


# 时间戳   1970.1.1 0:0
#   到当前  时间的秒数


# time.sleep(2)
# print('嘤嘤嘤')
#   等待  2秒 程序运行


# print(time.localtime())
# time.struct_time(tm_year=2019, tm_mon=6, tm_mday=25, tm_hour=10, tm_min=50, tm_sec=16, tm_wday=1, tm_yday=176, tm_isdst=0)
stime1 = time.localtime()
# print(stime1[0])
# stime2 = time.localtime(1561431345.2485876)
print(stime1)
# stime2 = stime1
# #   float 时间戳  -- time.localtime() --- 结构化时间
#

# #  由结构化时间转化为字符串
print(time.strftime('%Y -%m -%d',stime1))
print(time.strftime('%Y',stime1))
print(time.strftime('%m',stime1))
print(time.strftime('%d',stime1))
# n = time.strftime('%Y',stime2)
# print(type(n))
# print(time.strftime('%m',stime2))
# print(time.strftime('%d',stime2))
# print(time.strftime('%m- %d- %Y',stime2))
# print(time.strftime('%Yyear- %mmonth- %dday',stime2))
# print(time.strftime('%m- %d- %Y',stime2))
# #    stime2   < class str >
# str = time.strftime('%Y- %m- %d',stime2)
# print(type(str))
# #    stime2   < class str >
# print(str)
#
#
# # 由一个字符串转化为结构化的时间
# print(time.strptime('2019- 06- 25','%Y- %m- %d'))
#
# #  由结构化时间 转为 时间戳
# #   mktime
# stm = time.strptime('2019- 06- 25','%Y- %m- %d')
# print(stm)
# print(time.mktime((stm)))



